'use strict';

/**
 * Config for the router
 */
angular.module('app')
    .run(
    ['$rootScope', '$state', '$stateParams',
        function ($rootScope, $state, $stateParams) {
            $rootScope.$state = $state;
            $rootScope.$stateParams = $stateParams;
            $rootScope.imgurl = 'http://192.168.0.109:9004/api/file/getfile?id=';
            // $rootScope.imgurl = 'https://file.youlijinfu.com/';
            var locationChangeStartOff = $rootScope.$on('$stateChangeStart', function(event, toState){
                Menu.Instance().getData(function (data) {
                    if(data.Code==1){
                        var menus = ['login','index'];
                        for (var i = 0; i < data.Data.length; i++) {
                            var item = data.Data[i];
                            menus.push(item.Url);
                        }
                        var toStateName = toState.name
                        for (var i = 0; i < menus.length; i++) {
                            if (menus[i]==toStateName) {
                                break;
                            }else if(i == menus.length-1 && menus[i]!=toStateName){
                                window.location.replace('/#/login')
                            }
                        }
                    }else if(data.Code==8){
                        window.location.hash = '/login'
                    }
                })
            })

        }
    ]
    )
    .config(
    ['$stateProvider', '$urlRouterProvider',
        function ($stateProvider, $urlRouterProvider) {
            var version = window.version
            $urlRouterProvider
                .otherwise('/login');
            $stateProvider
                .state('app', {//入口
                    abstract: true,
                    url: '/app',
                    templateUrl: 'tpl/app.html?v=' + version
                })
                .state('index', {//登陆后页面
                    url: '/index',
                    templateUrl: 'tpl/index.html?v=' + version,
                    controller: '',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/seting/setting_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('login', {//login
                    url: '/login',
                    templateUrl: 'tpl/login.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/seting/setting_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'login'
                })
                .state('app.setting', {//系统管理
                    url: '/setting',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.setting.menu', {//菜单管理
                    url: '/menu',
                    templateUrl: 'tpl/setting/menu.html?v=' + version,
                    controller: 'menu',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/seting/setting_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.setting.setting', {//配置中心
                    url: '/setting',
                    templateUrl: 'tpl/setting/setting.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/seting/setting_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'setting'
                })
                .state('app.setting.staff', {//员工管理
                    url: '/staff',
                    templateUrl: 'tpl/setting/staff.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/seting/setting_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'staff'
                })
                .state('app.customer', {//客服
                    url: '/customer',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.customer.customercenter', {//客服配置中心
                    url: '/customercenter',
                    templateUrl: 'tpl/customer/customercenter.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'customercenter'
                })
                // .state('app.customer.Orderinquiry', {//富民订单查询
                //     url: '/Orderinquiry',
                //     templateUrl: 'tpl/customer/Orderinquiry.html?v=' + version,
                //     controller: 'Orderinquiry',
                //     resolve: {
                //         deps: ['$ocLazyLoad',
                //             function ($ocLazyLoad) {
                //                 return $ocLazyLoad.load('toaster').then(
                //                     function () {
                //                         return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                //                     }
                //                 );
                //             }]
                //     }
                // })
                .state('app.customer.inviterecord', {//用户邀请记录
                    url: '/inviterecord',
                    templateUrl: 'tpl/customer/inviterecord.html?v=' + version,
                    controller: 'inviterecord',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.customer.inviteinfo', {//邀请人信息
                    url: '/inviteinfo',
                    templateUrl: 'tpl/customer/inviteinfo.html?v=' + version,
                    controller: 'inviteinfo',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.customer.invitedefault', {//邀请好友初始值设置
                    url: '/invitedefault',
                    templateUrl: 'tpl/customer/invitedefault.html?v=' + version,
                    controller: 'invitedefault',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.customer.hforderinquiry', {//汇付订单查询
                    url: '/hforderinquiry',
                    templateUrl: 'tpl/customer/hforderinquiry.html?v=' + version,
                    controller: 'hforderinquiry',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.customer.userinfo', {//用户信息
                    url: '/userinfo',
                    templateUrl: 'tpl/customer/userinfo.html?v=' + version,
                    controller: 'userinfo',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.customer.anxin', {//客服配置中心
                    url: '/anxin',
                    templateUrl: 'tpl/customer/anxin.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/customer/customer_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'anxin'
                })
                .state('app.pro', {
                    url: '/pro',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.pro.product', {//产品管理列表
                    url: '/index',
                    templateUrl: 'tpl/product/regular/index.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/index/index_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'index'
                })
                .state('app.flie', {//demo上传测试文件
                    url: '/file',
                    templateUrl: 'tpl/product/regular/file.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('angularFileUpload').then(
                                    function () {
                                        return $ocLazyLoad.load('js/controllers/file-upload.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.pro.producthuo', {//活期产品管理列表
                    url: '/producthuo',
                    templateUrl: 'tpl/product/current/producthuo.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/index/index_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'producthuo'
                })
                .state('app.pro.queryorder', {//订单详情查询
                    url: '/queryorder',
                    templateUrl: 'tpl/product/queryorder/queryorder.html?v=' + version,
                    controller: 'queryorder',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/index/index_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.pro.productgroup', {//产品组页面
                    url: '/product',
                    templateUrl: 'tpl/product/productgroup/product.html?v=' + version,
                    controller: 'productgroup',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/product/product_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.pro.borrower', {//借款人管理
                    url: '/borrower',
                    templateUrl: 'tpl/product/borrower/borrower.html?v=' + version,
                    controller: 'borrower',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/borrower/borrower_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.pro.virtual', {//虚拟人管理
                    url: '/virtual',
                    templateUrl: 'tpl/product/regular/virtual.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/borrower/borrower_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'virtual'
                })
                .state('app.pro.repayment', {//还款明细
                    url: '/repayment',
                    templateUrl: 'tpl/product/regular/repayment.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/repayment/repayment_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'repayment'
                })
                .state('app.pro.dayrepayment', {//每日还款明细
                    url: '/dayrepayment',
                    templateUrl: 'tpl/product/regular/dayrepayment.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/repayment/repayment_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'dayrepayment'
                })
                .state('app.finance', {//财务管理
                    url: '/finance',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                // .state('app.finance.transition', { //过渡期还款统计
                //     url: '/transition',
                //     templateUrl: 'tpl/finance/transition.html?v=' + version,
                //     controller: 'transition',
                // })
                .state('app.finance.handrefund', { //富民手动退款记录
                    url: '/handrefund',
                    templateUrl: 'tpl/finance/handrefund.html?v=' + version,
                    controller: 'handrefund',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/finance/redpacket_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.finance.expectrepayment', { //借款人还款金额计划
                    url: '/expectrepayment',
                    templateUrl: 'tpl/finance/expectrepayment.html?v=' + version,
                    controller: 'expectrepayment',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/finance/redpacket_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.finance.Repaymentmanagement', { //还款管理
                    url: '/Repaymentmanagement',
                    templateUrl: 'tpl/finance/Repaymentmanagement.html?v=' + version,
                    controller: 'Repaymentmanagement',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/finance/redpacket_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.finance.redpacket', { //红包和体验金到账
                    url: '/redpacket',
                    templateUrl: 'tpl/finance/redpacket.html?v=' + version,
                    controller: 'redpacket',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/finance/redpacket_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.finance.bbin', { //体验金发放
                    url: '/bbin',
                    templateUrl: 'tpl/finance/bbin.html?v=' + version,
                    controller: 'bbin',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/finance/redpacket_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.finance.currentstatistic', { //活期产品统计
                    url: '/currentstatistic',
                    templateUrl: 'tpl/finance/currentstatistic.html?v=' + version,
                    controller: 'currentstatistic',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/finance/redpacket_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate', { //运营管理
                    url: '/operate',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.operate.rankingmanage', { //排行榜活动管理 
                    url: '/rankingmanage',
                    templateUrl: 'tpl/operate/rankingmanage.html?v=' + version,
                    controller: 'rankingmanage',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.ranking', { //投资排行榜获奖记录
                    url: '/ranking',
                    templateUrl: 'tpl/operate/ranking.html?v=' + version,
                    controller: 'ranking',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.ad', { //广告管理 
                    url: '/ad',
                    templateUrl: 'tpl/operate/ad.html?v=' + version,
                    controller: 'ad',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.repayproductinfofoinvest', { //回款投资人
                    url: '/repayproductinfofoinvest',
                    templateUrl: 'tpl/operate/repayproductinfofoinvest.html?v=' + version,
                    controller: 'repayproductinfofoinvest',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.thousand', { //提现大于1000
                    url: '/thousand',
                    templateUrl: 'tpl/operate/thousand.html?v=' + version,
                    controller: 'thousand',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.notices', { //公告管理 
                    url: '/notices',
                    templateUrl: 'tpl/operate/notices.html?v=' + version,
                    controller: 'notices',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.savePlus', { //发放加息券
                    url: '/savePlus',
                    templateUrl: 'tpl/operate/saveplus.html?v=' + version,
                    controller: 'operate',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.savered', { //发放红包
                    url: '/savered',
                    templateUrl: 'tpl/operate/savered.html?v=' + version,
                    controller: 'savered',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operate.banklimit', { //银行卡限额
                    url: '/banklimit',
                    templateUrl: 'tpl/operate/banklimit.html?v=' + version,
                    controller: 'banklimit',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operate/operate_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operateform', { //运营报表
                    url: '/operateform',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.operateform.dailypaper', { //运营日报 
                    url: '/dailypaper',
                    templateUrl: 'tpl/operateform/dailypaper.html?v=' + version,
                    controller: 'dailypaper',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operateform/operateform_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operateform.monthlymagazine', { //运营日报 
                    url: '/monthlymagazine',
                    templateUrl: 'tpl/operateform/monthlymagazine.html?v=' + version,
                    controller: 'monthlymagazine',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operateform/operateform_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.operateform.investdistribution', { //投资分布 
                    url: '/investdistribution',
                    templateUrl: 'tpl/operateform/investdistribution.html?v=' + version,
                    controller: 'investdistribution',
                    resolve: {
                        deps: ['$ocLazyLoad', 'uiLoad',
                            function ($ocLazyLoad, uiLoad) {
                                return $ocLazyLoad.load(['toaster','js/controllers/chart.js']).then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operateform/operateform_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                }).state('app.operateform.realtimedata', { //实时数据
                    url: '/realtimedata',
                    templateUrl: 'tpl/operateform/realtimedata.html?v=' + version,
                    controller: 'realtimedata',
                    resolve: {
                        deps: ['$ocLazyLoad', 'uiLoad',
                            function ($ocLazyLoad, uiLoad) {
                                return $ocLazyLoad.load(['toaster','js/controllers/chart.js']).then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operateform/operateform_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                }).state('app.operateform.operatdaily', { //运营日报
                    url: '/operatdaily',
                    templateUrl: 'tpl/operateform/operatdaily.html?v=' + version,
                    controller: 'operatdaily',
                    resolve: {
                        deps: ['$ocLazyLoad', 'uiLoad',
                            function ($ocLazyLoad, uiLoad) {
                                return $ocLazyLoad.load(['toaster','js/controllers/chart.js']).then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/operateform/operateform_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.riskcontrol', {//风控管理
                    url: '/riskcontrol',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.riskcontrol.borrowcheck', {//借款人资质审核
                    url: '/borrowcheck',
                    templateUrl: 'tpl/riskcontrol/borrowcheck.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/riskcontrol/riskcontrol_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'borrowcheck'
                })
                .state('app.develop', {//开发管理
                    url: '/develop',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.develop.version', {//版本管理
                    url: '/version',
                    templateUrl: 'tpl/develop/version.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/develop/develop_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'version'
                })
                .state('app.develop.changecard', {//修改预留手机号
                    url: '/changecard',
                    templateUrl: 'tpl/develop/changecard.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/develop/develop_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'changecard'
                })
                .state('app.develop.editprice', {//修改可提现金额
                    url: '/editprice',
                    templateUrl: 'tpl/develop/editprice.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/develop/develop_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'editprice'
                })
                .state('app.develop.channel', {//渠道统计
                    url: '/channel',
                    templateUrl: 'tpl/develop/channel.html?v=' + version,
                    controller: 'channel',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/develop/develop_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.develop.cancelst', {//一键取消授权......
                    url: '/cancelst',
                    templateUrl: 'tpl/develop/cancelst.html?v=' + version,
                    controller: 'cancelst',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/develop/develop_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.develop.clearappointedcache', {//清除指定缓存......
                    url: '/clearappointedcache',
                    templateUrl: 'tpl/develop/clearappointedcache.html?v=' + version,
                    controller: 'clearappointedcache',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/develop/develop_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.statistics', {//统计管理
                    url: '/statistics',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.statistics.datastatistics', { //数据统计
                    url: '/datastatistics',
                    templateUrl: 'tpl/statistics/datastatistics.html?v=' + version,
                    controller: 'datastatistics',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/statistics/statistics_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.statistics.redelivery', { //渠道复投统计
                    url: '/redelivery',
                    templateUrl: 'tpl/statistics/redelivery.html?v=' + version,
                    controller: 'redelivery',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/statistics/statistics_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.statistics.quarter', {//季度留存
                    url: '/quarter',
                    templateUrl: 'tpl/statistics/quarter.html?v=' + version,
                    controller: 'quarter',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/statistics/statistics_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.statistics.business', {//经营日报
                    url: '/business',
                    templateUrl: 'tpl/statistics/business.html?v=' + version,
                    controller: 'business',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/statistics/statistics_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                // .state('app.statistics.business', {//经营日报
                //     url: '/business',
                //     template: '<iframe src="'+window.location.protocol+'//static.youlijinfu.com/Business/BusinessDailyListView" width="100%" height="800px"></iframe>',
                //     resolve: {
                //         deps: ['$ocLazyLoad',
                //             function ($ocLazyLoad) {
                //                 return $ocLazyLoad.load('toaster').then(
                //                     function () {
                //                         return $ocLazyLoad.load('js/app/statistics/statistics_controller.js?v=' + version);
                //                     }
                //                 );
                //             }]
                //     }
                // })
                .state('app.statistics.equipmentterminal', {//设备终端
                    url: '/equipmentterminal',
                    templateUrl: 'tpl/statistics/equipmentterminal.html?v=' + version,
                    controller: 'equipmentterminal',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/statistics/statistics_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.statistics.channellistview', {//渠道统计
                    url: '/channellistview',
                    templateUrl: 'tpl/statistics/channellistview.html?v=' + version,
                    controller: 'channellistview',
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/statistics/statistics_controller.js?v=' + version);
                                    }
                                );
                            }]
                    }
                })
                .state('app.recharge', {//汇付对账
                    url: '/recharge',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.recharge.checkrefund', {//商户扣款、还款对账
                    url: '/checkrefund',
                    templateUrl: 'tpl/recharge/checkrefund.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/recharge/reconciliation.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'checkrefund'
                })
                .state('app.recharge.hfreconciliation', {//汇付多单
                    url: '/hfreconciliation',
                    templateUrl: 'tpl/recharge/reconciliation.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/recharge/reconciliation.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'hfreconciliation'
                })
                .state('app.recharge.jereconciliation', {//金额不一致
                    url: '/jereconciliation',
                    templateUrl: 'tpl/recharge/jereconciliation.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/recharge/reconciliation.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'jereconciliation'
                })
                .state('app.recharge.ptreconciliation', {//平台多单
                    url: '/ptreconciliation',
                    templateUrl: 'tpl/recharge/ptreconciliation.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/recharge/reconciliation.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'ptreconciliation'
                })
                .state('app.recharge.pthfreconciliation', {//平台汇付对账
                    url: '/pthfreconciliation',
                    templateUrl: 'tpl/recharge/pthfreconciliation.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/recharge/reconciliation.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'pthfreconciliation'
                })
                .state('app.fixedpoint', {//特殊标
                    url: '/fixedpoint',
                    template: '<div ui-view class="fade-in-up"></div>'
                })
                .state('app.fixedpoint.product', {//定点产品管理列表
                    url: '/fixedpointproduct',
                    templateUrl: 'tpl/fixedpoint/fixedpoint.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/fixedpoint/fixedpoint_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'fixedpointproduct'
                })
                .state('app.fixedpoint.investor', {//特殊标管理
                    url: '/fixedpointinvestor',
                    templateUrl: 'tpl/fixedpoint/fixedpointinvestor.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/fixedpoint/fixedpoint_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'fixedpointinvestor'
                })
                .state('app.fixedpoint.details', {//特殊标预期还款明细
                    url: '/fixedpointdetails',
                    templateUrl: 'tpl/fixedpoint/fixedpointdetails.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/fixedpoint/fixedpoint_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'fixedpointdetails'
                })
                .state('app.fixedpoint.repayment', {//特殊标还款管理
                    url: '/fixedpointfinancerepayment',
                    templateUrl: 'tpl/fixedpoint/fixedpointfinancerepayment.html?v=' + version,
                    resolve: {
                        deps: ['$ocLazyLoad',
                            function ($ocLazyLoad) {
                                return $ocLazyLoad.load('toaster').then(
                                    function () {
                                        return $ocLazyLoad.load('js/app/fixedpoint/fixedpoint_controller.js?v=' + version);
                                    }
                                );
                            }]
                    },
                    controller: 'fixedpointfinancerepayment'
                })
        }
    ]);